.\"  Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
.\"
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
.\" Distributed under GPL
.\" %%%LICENSE_END
.\"
.\"  I had no way the check the functions out
.\"  be careful
.TH KEY_SETSECRET 3 2015-07-23 "" "Linux Programmer's Manual"
.SH NAME
key_decryptsession, key_encryptsession, key_setsecret, key_gendes,
key_secretkey_is_set \- interfaces to rpc keyserver daemon
.SH SYNOPSIS
.B "#include <rpc/rpc.h>"
.sp
.BI "int key_decryptsession(char *" remotename ,
.BI "des_block *" deskey );
.sp
.BI "int key_encryptsession(char *" remotename ,
.BI "des_block *" deskey );
.sp
.BI "int key_gendes(des_block *" deskey );
.sp
.BI "int key_setsecret(char *" key );
.sp
.B "int key_secretkey_is_set(void);"
.SH DESCRIPTION
The functions here are used within the RPC's secure authentication
mechanism (AUTH_DES).
There should be no need for user programs to
use this functions.

The function
.BR key_decryptsession ()
uses the (remote) server netname and takes the DES key
for decrypting.
It uses the public key of the server and the
secret key associated with the effective UID of the calling process.

The function
.BR key_encryptsession ()
is the inverse of
.BR key_decryptsession ().
It encrypts the DES keys with the public key of the server and
the secret key associated with the effective UID of the calling process.

The function
.BR key_gendes ()
is used to ask the keyserver for a secure conversation key.

The function
.BR key_setsecret ()
is used to set the key for the effective UID of the calling process.

The function
.BR key_secretkey_is_set ()
can be used to determine whether a key has been
set for the effective UID of the calling process.
.SH RETURN VALUE
These functions return 1 on success and 0 on failure.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
.TS
allbox;
lbw22 lb lb
l l l.
Interface	Attribute	Value
T{
.BR key_decryptsession (),
.br
.BR key_encryptsession (),
.br
.BR key_gendes (),
.br
.BR key_setsecret (),
.br
.BR key_secretkey_is_set ()
T}	Thread safety	MT-Safe
.TE

.SH NOTES
Note that we talk about two types of encryption here.
One is asymmetric using a public and secret key.
The other is symmetric, the
64-bit DES.
.PP
These routines were part of the Linux/Doors-project, abandoned by now.
.SH SEE ALSO
.BR crypt (3)
